import 'package:flutter/material.dart';

extension Iterables<E> on Iterable<E> {
  Map<K, List<E>> groupBy<K>(K Function(E element) keyFunction) => fold(
      <K, List<E>>{},
          (Map<K, List<E>> map, E element) =>
      map..putIfAbsent(keyFunction(element), () => <E>[]).add(element));
}

//List<void Function()> _listeners = [];
//
//extension LoadMoreExtension on ScrollController {
//  void addOnLoadMoreListener(void listener()) {
//    _listeners.add(listener);
//    this.add
//  }
//  void removeOnLoadMoreListener(void listener()) {
//    _listeners.remove(listener);
//  }
//}